package org.hqs.feign.clients;

import org.hqs.feign.common.JsonResult;
import org.hqs.feign.pojo.Admin;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "adminservice")
public interface AdminClient {
    @GetMapping("/admin/{adminId}")
    public JsonResult<Admin> getAdminById(@PathVariable Long adminId);

    @GetMapping("/admin/findAll")
    public JsonResult<List<Admin>> findAllAdmins();

    @PostMapping("/admin/add")
    public JsonResult addAdmin(@RequestBody Admin admin);

    @PutMapping("/admin/update")
    public JsonResult updateAdmin(@RequestBody Admin admin);

    // 删除管理员信息
    @DeleteMapping("/admin/delete")
    public JsonResult deleteAdmin(@RequestBody Admin admin);
}
